<template name="feedback">
    <p>感谢各位的支持，网站有任何不完善的地方，请各位多提建议</p>

    <form name="comment" class="comment-form form">
        <div class="form-group">
            <div class="controls">
                <textarea name="body" id="body" class="form-control" rows="5"></textarea>
                <span class="help-block"></span>
            </div>
        </div>
        <button type="submit" class="btn btn-primary">反馈我的意见</button>
    </form>

    <label for="feedback">历史反馈</label>
    <div class="posts" name="feedback">
        {{#each feedback}}
            {{> feedbackItem}}
        {{/each}}
    </div>
</template>


<template name="feedbackItem">
    <div class="post">
        <div class="post-content">
            <h3>{{name}}&nbsp;&nbsp;<span>at {{time}}</span></h3>
            <p>
                {{content}}
            </p>
        </div>
        {{#if isAdmin}}
            {{!--<a href="" class="discuss btn btn-default">回复</a>--}}

            <!-- Button trigger modal -->
            <button type="button" class="discuss btn btn-default" data-toggle="modal" data-target="#myModal">
                回复
            </button>

            <!-- Modal -->
            <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
                <div class="modal-dialog" role="document">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                            <h4 class="modal-title" id="myModalLabel">回复反馈</h4>
                        </div>
                        <form name="reply" class="form">
                            <div class="modal-body">
                                <div class="form-group">
                                    <div class="controls">
                                        <textarea name="feedbackBody" class="form-control" rows="5"></textarea>
                                        <span class="help-block"></span>
                                    </div>
                                </div>
                            </div>

                            <div class="modal-footer">
                                <button type="submit" class="btn btn-primary">确定回复</button>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        {{/if}}
    </div>


    {{!-- 管理员回复 --}}
    {{#if reply.content}}
    <ul class="comments">
        <li>
            <h4>
                <span class="author">sharelinks</span>
                <span class="date">on {{reply.time}}</span>
            </h4>
            <p>{{reply.content}}</p>
        </li>
    </ul>
    {{/if}}
</template>